<template>
	<view class="cell-page">
		<view class="u-page__item">
			<!-- <text class="u-page__item__title">基础功能</text> -->
			<br>
			<br>
			
			<u-cell-group>
				<u-cell
				    title="修改密码"
				   	@click="Change_password"
				    :isLink="true"
				></u-cell>
				
			
				<u-cell
				    title="用户隐私保护政策"
				   
				    :isLink="true"
				></u-cell>
			
				<u-cell
				    title="退出登录"
					@click="out_login"
				    :isLink="true"
				></u-cell>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	import token from '@/common/token/token.js'
	
	export default {
		data() {
			return {
				
			};
		},
		methods:{
			out_login(){
				// uni.removeStorageSync('token');
				uni.setStorageSync("userid",0);
				uni.setStorageSync("token",null)
				// this.$route.go(0);
				uni.switchTab({
					url:'/pages/home/home'
				})
			},
			Change_password(){
				uni.navigateTo({
					url:'/pages/user/set_up/Change_password/Change_password'
				})
				
			}
		},
		created(){
			  // const token = uni.getStorageSync('token');
			  // const [headerB64, payloadB64, signature] = token.split('.');
			  
			  // // Step 2: 解码头部和载荷
			  // const headerJson = atob(headerB64);
			  // const payloadJson = atob(payloadB64);
			  
			  // // Step 3: 解析成 JavaScript 对象
			  // const header = JSON.parse(headerJson);
			  // const payload = JSON.parse(payloadJson);
			  
			  console.log("id-----------"+token.id);
			  // console.log("payload-------------"+token.username);
			  
			  console.log(uni.getStorageSync('token'));
			  
		}
	}
</script>

<style lang="scss">
	.cell-page {
		padding-bottom: 20px;
	}

	.cell-box {
		&__title {
			font-size: 14px;
			color: rgb(143, 156, 162);
			margin: 20px 0px 0px 15px;
		}

		&__block {
			// background-color: #fff;
			margin-top: 20px;
		}
	}

	.u-page {
		padding: 0;

		&__item {

			&__title {
				color: $u-tips-color;
				background-color: $u-bg-color;
				padding: 15px;
				font-size: 15px;

				&__slot-title {
					color: $u-primary;
					font-size: 14px;
				}
			}
		}
	}

	.u-slot-title {
		@include flex;
		flex-direction: row;
		align-items: center;
	}

	.u-cell-text {
		font-size: 15px;
		line-height: 22px;
		color: #303133;
		margin-right: 5px;
	}

	.u-slot-value {
		line-height: 17px;
		text-align: center;
		font-size: 10px;
		padding: 0 5px;
		height: 17px;
		color: #FFFFFF;
		border-radius: 100px;
		background-color: #f56c6c;
	}
</style>
